//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class ShapeLocking : Locking, IOfficeXmlSerializable
    {
        private bool noTextEdit;

        public bool NoTextEdit
        {
            get { return noTextEdit; }
            set { noTextEdit = value; }
        }

        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (var c = context.Read("spLocks"))
            {
                ReadAttributes(c);
                NoTextEdit = c.GetOptionalBoolean("noTextEdit", false);
                c.WarnIf("ext");
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("spLocks"))
            {
                WriteAttributes(c);
                c.SetOptionalBoolean("noTextEdit", NoTextEdit, false);
                c.WarnIf("ext");
            }
        }

        #endregion
    }
}